-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Sema] Downgrade noasync
diagnostic to warning for closure macro args
#80853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Sema] Downgrade noasync
diagnostic to warning for closure macro args
#80853
Conversation
@swift-ci please test |
@swift-ci please test source compatibility |
// argument until the next language mode. | ||
auto shouldWarnUntilFutureVersion = [&]() { | ||
auto *CE = dyn_cast<ClosureExpr>(noAsyncDC); | ||
return CE && CE->isMacroArgument(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was originally hoping we could use namelookup::isInMacroArgument
here, but we don't currently track macro expansion expressions in the ASTScope tree and it didn't really seem worth it for this change.
Previously we would avoid rewriting the arguments in CSApply, but that can result in incorrect behavior in MiscDiagnostics passes, e.g incorrectly treating all closure arguments as escaping. Make sure we rewrite the arguments as we would in regular type-checking. rdar://148665502
Introduce `Version::getFutureMajorLanguageVersion` to make it easier to find clients that will need to be updated once we have a new language mode.
Downgrade to a warning until the next language mode. This is necessary since we previously missed coercing macro arguments to parameter types, resulting in cases where closure arguments weren't being treated as `async` when they should have been. rdar://149328745
cba6b5f
to
b36eb57
Compare
@swift-ci please test |
Downgrade to a warning until the next language mode. This is necessary since we previously missed coercing macro arguments to parameter types, resulting in cases where closure arguments weren't being treated as
async
when they should have been. This then allows us to reapply #80583.rdar://149328745
Resolves #80835